<template>
	<view>
		<view class="tips_wrapper p_flex2">
			<image src="https://dy.sykj365.com/uploads/mini/laba.png" class="p_img_32 p_margin_r_16"></image>
			<swiper autoplay circular vertical :interval="2000" style="flex: 1;height: 100%;">
				<swiper-item v-for="(item, index) in notice" :key="index">
					<view class="p_font_24 p_color_05b570 p_flex_1 p_one_text" style="height: 100%;line-height: 50rpx;">{{item}}</view>
				</swiper-item>
			</swiper>
		</view>
		<image :src="image" mode="widthFix" class="img" show-menu-by-longpress></image>
		<view class="p_font_28 p_color_b2 p_text_c">长按识别二维码，添加微信</view>
		<view class="p_font_28 p_text_c" style="margin-top: 80rpx;">如需批量打印，请添加工作人员微信</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				image: '',
				notice: [],
			}
		},
		onLoad() {
			this.getInfo();
			this.getNotice();
		},
		methods: {
			getInfo() {
				this.$http.post(this.$api.priceRemark).then(res => {
					this.image = res.data.image;
				})
			},
			// 获取公告
			getNotice() {
				this.$http.get(this.$api.systemNotice).then((res) => {
					if(res.notice.length === 0) {
						res.notice = ['暂无公告~']
					}
					this.notice = res.notice;
				})
			},
		}
	}
</script>

<style lang="less">
	.img {
		width: 496rpx;
		height: 496rpx;
		margin: 160rpx auto 48rpx;
	}
	
	.tips_wrapper {
		height: 50rpx;
		padding: 0 32rpx;
		background-color: #DBECE5;
	}
</style>